package com.itheima.dao;

import com.itheima.domain.Account;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface AccountDao {
    @Insert("insert into account (name ,money) values (#{name},#{money})")
    public abstract void save(Account account);

    @Update("update account set name=#{name},money=#{money} where id=#{id}")
    public abstract void update(Account account);

    @Delete("delete from account where id=#{id}")
    public abstract void delete(int id);

    @Select(" select * from account")
    public abstract List<Account> findAll();

    @Select(" select * from account where id=#{id}")
    public abstract Account findById(int id);
}
